x11: Remove display_x11->have_render
authorBenjamin Otte <otte@redhat.com>
Fri, 6 Aug 2010 02:36:17 +0000 (04:36 +0200)
committerBenjamin Otte <otte@redhat.com>
Tue, 10 Aug 2010 19:02:30 +0000 (21:02 +0200)
Also remove setters and getters for the variable and the GdkTristate
enum, as it's the only place where it was used.

gdk/x11/gdkdisplay-x11.c
gdk/x11/gdkdisplay-x11.h
gdk/x11/gdkdrawable-x11.c
gdk/x11/gdkprivate-x11.h

index 9b61238aa4b7d997e02fad9bb00929639b4e685c..5aeb0170b29541e91d2501d974c72d3a301e6c2b 100644 (file)
@@ -1257,8 +1257,6 @@ gdk_display_open (const gchar *display_name)
 
   display_x11->leader_window_title_set = FALSE;
 
-  display_x11->have_render = GDK_UNKNOWN;
-
 #ifdef HAVE_XFIXES
   if (XFixesQueryExtension (display_x11->xdisplay, 
                            &display_x11->xfixes_event_base, 
index 86beda5b00967465c242f5f9726de8e820fcd61e..87496d4321b0d6584b8b112257cb66b1f93bdaca 100644 (file)
@@ -45,13 +45,6 @@ typedef struct _GdkDisplayX11Class GdkDisplayX11Class;
 #define GDK_IS_DISPLAY_X11_CLASS(klass)   (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_DISPLAY_X11))
 #define GDK_DISPLAY_X11_GET_CLASS(obj)    (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_DISPLAY_X11, GdkDisplayX11Class))
 
-typedef enum 
-{
-  GDK_UNKNOWN,
-  GDK_NO,
-  GDK_YES
-} GdkTristate;
-
 struct _GdkDisplayX11
 {
   GdkDisplay parent_instance;
@@ -76,7 +69,6 @@ struct _GdkDisplayX11
   GdkKeymap *keymap;
   guint            keymap_serial;
 
-  GdkTristate have_render;
   gboolean have_xfixes;
   gint xfixes_event_base;
 
index 92047459189471f6de805f2713e9b5d33c850b9e..02efc0d8405687e5b7d6744764585f90f8e6c048 100644 (file)
@@ -136,94 +136,6 @@ _gdk_x11_drawable_update_size (GdkDrawable *drawable)
     }
 }
 
-static void
-try_pixmap (Display *xdisplay,
-           int      screen,
-           int      depth)
-{
-  Pixmap pixmap = XCreatePixmap (xdisplay,
-                                RootWindow (xdisplay, screen),
-                                1, 1, depth);
-  XFreePixmap (xdisplay, pixmap);
-}
-
-gboolean
-_gdk_x11_have_render (GdkDisplay *display)
-{
-  Display *xdisplay = GDK_DISPLAY_XDISPLAY (display);
-  GdkDisplayX11 *x11display = GDK_DISPLAY_X11 (display);
-
-  if (x11display->have_render == GDK_UNKNOWN)
-    {
-      int event_base, error_base;
-      x11display->have_render =
-       XRenderQueryExtension (xdisplay, &event_base, &error_base)
-       ? GDK_YES : GDK_NO;
-
-      if (x11display->have_render == GDK_YES)
-       {
-         /*
-          * Sun advertises RENDER, but fails to support 32-bit pixmaps.
-          * That is just no good.  Therefore, we check all screens
-          * for proper support.
-          */
-
-         int screen;
-         for (screen = 0; screen < ScreenCount (xdisplay); screen++)
-           {
-             int count;
-             int *depths = XListDepths (xdisplay, screen, &count);
-             gboolean has_8 = FALSE, has_32 = FALSE;
-
-             if (depths)
-               {
-                 int i;
-
-                 for (i = 0; i < count; i++)
-                   {
-                     if (depths[i] == 8)
-                       has_8 = TRUE;
-                     else if (depths[i] == 32)
-                       has_32 = TRUE;
-                   }
-                 XFree (depths);
-               }
-
-             /* At this point, we might have a false positive;
-              * buggy versions of Xinerama only report depths for
-              * which there is an associated visual; so we actually
-              * go ahead and try create pixmaps.
-              */
-             if (!(has_8 && has_32))
-               {
-                 gdk_error_trap_push ();
-                 if (!has_8)
-                   try_pixmap (xdisplay, screen, 8);
-                 if (!has_32)
-                   try_pixmap (xdisplay, screen, 32);
-                 XSync (xdisplay, False);
-                 if (gdk_error_trap_pop () == 0)
-                   {
-                     has_8 = TRUE;
-                     has_32 = TRUE;
-                   }
-               }
-             
-             if (!(has_8 && has_32))
-               {
-                 g_warning ("The X server advertises that RENDER support is present,\n"
-                            "but fails to supply the necessary pixmap support.  In\n"
-                            "other words, it is buggy.");
-                 x11display->have_render = GDK_NO;
-                 break;
-               }
-           }
-       }
-    }
-
-  return x11display->have_render == GDK_YES;
-}
-
 /*****************************************************
  * X11 specific implementations of generic functions *
  *****************************************************/
index 3ea4b4d58a0bea5e614df8614c5f3eaf79a64a7c..70693b4dee9dc42ab93319b08260980e8efc0009 100644 (file)
@@ -72,8 +72,6 @@ gint _gdk_send_xevent      (GdkDisplay *display,
                            glong       event_mask,
                            XEvent     *event_send);
 
-gboolean _gdk_x11_have_render           (GdkDisplay *display);
-
 /* Routines from gdkgeometry-x11.c */
 void _gdk_window_move_resize_child (GdkWindow     *window,
                                     gint           x,